home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / utility1 / gs261src.zip / PV.SH < prev    next >
Linux/UNIX/POSIX Shell Script  |  1991-03-03  |  477b  |  23 lines

  1. #!/bin/sh -f
  2. #
  3. # pv - preview a specified page of a dvi file in a Ghostscript window
  4. # usage: pv page file
  5. #
  6. # pv converts the given page to PostScript and displays it
  7. # in a Ghostscript window.
  8. #
  9. if [ $# -lt 2 ] ;then
  10.   echo usage: $0 'page_number file_name[.dvi]'
  11.   exit 1
  12. fi
  13. RESOLUTION=100
  14. TEMPDIR=.
  15. PAGE=$1
  16. shift
  17. FILE=$1
  18. shift
  19. trap "rm -rf $TEMPDIR/$FILE.$$.pv" 0 1 2 15
  20. dvips -D$RESOLUTION -p $PAGE -n 1 $FILE $* -o $FILE.$$.pv
  21. gs $FILE.$$.pv
  22. exit 0
  23.